package com.yuyou.tas.lesson.mapper;

import com.yuyou.tas.service.api.lesson.dto.DtoLessonMaterial;
import com.yuyou.tas.service.api.lesson.dto.DtoLessonMaterialWithName;
import com.yuyou.tas.service.api.lesson.entity.LessonMaterial;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LessonMaterialMapper {
    int deleteByPrimaryKey(Long id);

    int insert(LessonMaterial record);

    LessonMaterial selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(LessonMaterial record);
    int findLessonMaterialCount(Pagination<DtoLessonMaterial> queryPgn);
    List<DtoLessonMaterial> findLessonMaterialPageList(Pagination<DtoLessonMaterial> queryPgn);

    LessonMaterial selectByPKandOrgan(@Param(value="id") Long id, @Param(value="authOrganizationId") Long authOrganizationId);
    
    List<LessonMaterial> findLeMatByLessonId(Long lessonId);

    LessonMaterial findByLessonMaterialId(@Param(value = "lessonId")Long lessonId , @Param(value = "m_id") Long m_id);

    List<DtoLessonMaterialWithName> findLeMatNameByLessonId(@Param(value = "lessonId")Long lessonId);

    List<String> findBaseMatInLesson(@Param(value = "baseMaterialId") Long baseMaterialId);

    Integer findCountBaseMatInLesson(@Param(value = "baseMaterialId") Long baseMaterialId);

    void delByless(@Param(value="lessonId")Long lessonId);
}